export default {
  handleLyric(e){
    let rule = /\[(.+?)]/g
    let timeArr = e.match(rule)
    for(let i=0;i<timeArr.length;i++){
      timeArr[i] = parseFloat(timeArr[i].slice(1,3))*60+parseFloat(timeArr[i].slice(4,6))+parseFloat(timeArr[i].slice(7,10))*0.001
    }
    let lyric = e.replace(rule,"")
    let lyricArr = lyric.split('\n')
    return {
      lyric: lyric,
      timeArr: timeArr,
      lyricArr: lyricArr
    }
  }
}
